import os
import sys
from google.appengine.ext import webapp
from google.appengine.ext.webapp import template
from models.personal import Personal

class PersonalService():
	class Index(webapp.RequestHandler):
		def get(self):
			path = os.path.join(os.path.dirname(__file__), '../views/personal/index.html')
			html = template.render(path, { 'personal' : Personal.get()})
			self.response.out.write(html)
			
		def post(self):
			personal = Personal.get()
			personal.name              = str(self.request.get('name'))
			personal.company           = str(self.request.get('company'))
			personal.workDescription   = str(self.request.get('workDescription'))
			personal.phone             = str(self.request.get('phone'))
			personal.email             = str(self.request.get('email'))
			personal.address           = str(self.request.get('address'))
			personal.irdNumber         = str(self.request.get('irdNumber'))
			personal.bank              = str(self.request.get('bank'))
			personal.bankNumber        = str(self.request.get('bankNumber'))
			personal.bankBranch        = str(self.request.get('bankBranch'))
			personal.bankAccountName   = str(self.request.get('bankAccountName'))
			personal.put()
			self.response.out.write('ok')
			